/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bice.backbean;

import com.bice.controller.entity.BiceUser;
import com.bice.controller.entity.Post;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Sirius
 */
@SessionScoped
@ManagedBean
public class SessionBean extends BackBean {
    
    private BiceUser user;
    private Post post;

    public SessionBean() {
        Logger.getLogger(SessionBean.class.getName()).log(Level.INFO, "Init session bean");
    }
    
    public boolean isLogged() {
        return user != null;
    }
    
    public void logOff() {
        user = null;
    }

    public void setUser(BiceUser user) {
        this.user = user;
    }
    
    public BiceUser getUser() {
        return user;
    }
    
    public Post getPost() {
        return post;
    }

    public void setPost(Post post) {
        this.post = post;
    }

}